package com.qifenqian.turbot.module.ui.order

import android.support.v4.app.Fragment
import android.view.View
import com.qifenqian.turbot.R
import com.qifenqian.turbot.base.BaseFragment
import com.qifenqian.turbot.module.adapter.order.OrderPagerAdapter
import com.qifenqian.turbot.module.contract.OrderContract
import com.qifenqian.turbot.module.presenter.OrderPresenter
import com.qifenqian.turbot.module.ui.order.orders.TradeOrderFragment
import com.qifenqian.turbot.module.ui.order.reception.ReceptionFragment
import com.qifenqian.turbot.module.ui.order.table.TableFragment
import kotlinx.android.synthetic.main.fragment_order.view.*

/**
 * @author H
 * @createDate 2019/1/9 17:42
 * @description 主页订单界面
 * @see
 * @since
 */
class OrderFragment : BaseFragment<OrderPresenter, OrderContract.View>(), OrderContract.View {

    override fun bindLayoutId(): Int {
        return R.layout.fragment_order
    }

    override fun bindPresenter(): OrderPresenter? {
        return OrderPresenter(activity!!, this)
    }

    private val mFragmentList = mutableListOf<Fragment>(ReceptionFragment(), TableFragment(), TradeOrderFragment())
    private val mTitles = mutableListOf("接待", "桌位", "订单")
    override fun initial(view: View) {
        view.vp_order.adapter = OrderPagerAdapter(childFragmentManager, mTitles, mFragmentList)
        view.tl_order.setupWithViewPager(view.vp_order)
    }

}
